﻿using MyNeighbourhood.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MyNeighbourhood.Data;

namespace MyNeighbourhood.Managers
{
    public class BaseManager
    {
        protected SocialhoodDBEntities dbContext = new SocialhoodDBEntities();

        public Array GetAllEventTypes()
        {
            return Enum.GetValues(typeof(EventType));
        }

        public List<TargetType> GetDefaultTargetTypes()
        {
            return dbContext.TargetTypes.ToList();
        }

        public List<Event> GetAllEvents()
        {
            return dbContext.Events.ToList();
        }

        public TargetType GetTargetTypeById(int id)
        {
            return dbContext.TargetTypes.Find(id);
        }

        public Location GetLocationById(int id)
        {
            return dbContext.Locations.Find(id);
        }
    }
}